function applyDelete(id){
	if(confirmDelete()){
		$("#deleteApplyId").val(id);
		$("form:first").submit();
		return;
	}else{
		$("#deleteApplyId").val("");
		return;
	}
}

function checkApplyCode(applyId){
	var url="CheckApplyCode.do?id="+applyId;
	openModalDialog(url,750,450);
}


function validateApplyCensor(){
	var applyCode=$(":input[name='map[applyCode]']").val();
	var inspectorId=$(":input[name='map[inspectorId]']:checked");
	var censorResult=$(":input[name='censorResult']:checked");
	if(applyCode.length!=9||applyCode.indexOf('PD')!=0){
		alert("请填写备案号,类似\"PD2009001\"");
		return false;
	}
	if(inspectorId.length==0){
		alert("请选择监管人");
		return false;
	}
	if(censorResult.length==0){
		alert("请选择审核/审批结果");
		return false;
	}
	return true;
}

function applyExport(applyId){
	$("#applyId").val(applyId);
	$("#ApplyExport").submit();
	return true;
}

function validApplyEdit(){
	var array=["beginDate","endDate","exhProp","itemSort","sheetType","trePlan"];
	var ele;
	var re=true;
	for ( var n = 0; n < array.length; n++) {
		ele=document.getElementsByName(array[n]);
		if(ele.length==1){
			ele=$(ele[0]);
			if(ele.val()==null||ele.val().length==0){
				ele.attr("Message");
				re=false;
				break;
			}
		}else if(ele.length>1){
			var s="input[name='"+array[n]+"']:checked";
			if($(s).length==0){
				ele=$(ele[0]);
				alert(ele.attr("comment"));
				re=false;
				break;
			}
		}
	}
	return re;
}